package 二叉树相关问题.BST;

public class 插入操作 {

    public TreeNode insertIntoBST(TreeNode root, int val) {
        if (root==null)
            return new TreeNode(val);
        if (root.val<val)
            root.right=insertIntoBST(root.right,val);
        else
            root.left=insertIntoBST(root.left,val);
        return root;
    }
}
